package test.suite.tkaframework.support.component.modelManager
{

import org.teotigraphix.tka.patterns.component.ToolKitComponent;

import test.suite.tkaframework.support.skin.TestComponentSkin;

public class TestComponentModelManager 
	   extends ToolKitComponent
	   implements ITestComponentModelManager
{
	// !!! If there is no [ModelBinding] meta on these properites, 
	//     a change to them WILL NOT update the Model even if the propertyName
	//     is listed as a value interest in the Model.
	
	// !!! If there is no [Bindable] meta on theses properties,
	//     a change to them WILL NOT update the model since the Model is not
	//     getting notified in any way by an Event or PropertyChangeEvent
	
	// !!! The CAN be no [Bindable] meta IF a PropertyChangeEvent 
	//     is dispatched, this will probably not work in future version
	//     since the ModelManager needs to know when to add an event
	
	private var _modelPropertyOne:String;
	
	[Bindable]
	[ModelBinding]
	public function get modelPropertyOne():String
	{
		return _modelPropertyOne;
	}
	
	public function set modelPropertyOne(value:String):void
	{
		_modelPropertyOne = value;
	}
	
	
	private var _modelPropertyTwo:String;
	
	[Bindable]
	[ModelBinding]
	public function get modelPropertyTwo():String
	{
		return _modelPropertyTwo;
	}
	
	public function set modelPropertyTwo(value:String):void
	{
		_modelPropertyTwo = value;
	}	
	
	// tests;
	// 1. set coreModel
	// 2. unset coreModel
	// 3. modelLayer.registerModel()
	// 4. modelLayer.removeModel()
	
	
	// This happens when coreModel = model is called.
	// 
	// This needs an external param like push or pull values into component from model.
	// 
	// - use component initial values (push to model) [pre addChild()]
	// - use model initial values (push to component) [pre addChild()]
	//  
	// This happens when registerModel() is called AFTER addChild().
	// 
	// - use component current values (push to model) [post addChild()]
	// - use model current values (push to component) [post addChild()]
	 
	 
	public function TestComponentModelManager()
	{
		super();
		
		setStyle("skinClass", TestComponentSkin);
	}
}
}